/* 获取进程组ID */
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

int main(int argc, char **argv)
{
    pid_t pid = getpid();

    printf("进程组 ID<%d>--getpgrp()\n", getpgrp());
    printf("进程组 ID<%d>--getpgid()\n", getpgid(0));
    printf("进程组 ID<%d>--getpgid(%d)\n", getpgid(pid), pid);
}
